{extend name="wap/default_new/Shop/shopBase" /}

{block name="resources"}
<link rel="stylesheet" type="text/css" href="__TEMP__/{$style}/public/css/control_type.css">
<link rel="stylesheet" type="text/css" href="__TEMP__/{$style}/public/css/goods_list.css">
<link rel="stylesheet" type="text/css" href="__TEMP__/{$style}/public/css/shop_index.css">
<script type="text/javascript" src="__TEMP__/{$style}/public/js/collection_goods_or_shop.js"></script>
<script type="text/javascript" src="__TEMP__/{$style}/public/js/shop_index.js"></script>


<link rel="stylesheet" type="text/css" href="__TEMP__/{$style}/public/css/goods_list.css">
<script src="__TEMP__/{$style}/public/js/public_assembly.js" type="text/javascript"></script>
<style>
    .user-info-box {
        display: inline-block;
        height: 68px;
        line-height: 68px;
        width: 68px;
        text-align: center;
        vertical-align: top;
    }

    .user-logo-shop {
        display: inline-block !important;
        vertical-align: middle !important;
        max-width: 100% !important;
        max-height: 100% !important;
        height: auto !important;
    }
    .bottom{
        display: none;
    }
    .custom-search .custom-search-input{
        border-radius: 18px !important;
        border:0 !important;
        background: hsla(0,0%,100%,.4);
        color: #fff !important;
    }
    .user-info .shop_box{
        top: 30%;
        transform: translateY(-30%);
    }
    .user-info .shop_box .click_fav{
        border:1px solid #ddd;
        height: 25px;
        line-height: 25px;
        width: 75px;
        color: #ccc;
    }

    .user-info .shop_box .click_fav span{
        color: #ccc;
    }

    .user-nav{
        margin-top: 10px;
        border-top:1px solid #eee;
        padding: 15px 0 10px 0;
    }
</style>

{/block}

{block name="goodsHead"}
{if condition="$onekey_subscribe.url != ''AND $is_subscribe eq 0"}
<div class="fixed-focus-on">
    <i class="close" onclick="$('.fixed-focus-on').hide();">x</i>
    <div class="foucs-on-block">
        {if condition="$shop_info['shop_logo'] !=''"}
        <img class="user-bg" src="{$shop_info['shop_logo']}">
        {else/}
        <img class="user-bg" src="__TEMP__/{$style}/public/images/default/default_shop_avatar.png">
        {/if}
        {if condition="$source_user_name !=''"}
        <p>{:lang('i_am_your_best_friend')}<span>{$source_user_name}</span>,{:lang('recommended_to_you_business_from_now')}
        </p>
        <button onclick="location.href='{$onekey_subscribe.url}'">{:lang('click_on_the_attention')}</button>
        {else/}
        <p>
            {:lang('you_are_not_currently_concerned_about_the_WeChat_public_account')}，{:lang('click_on_the_attention')}</p>
        <button onclick="location.href='{$onekey_subscribe.url}'">{:lang('click_on_the_attention')}</button>
        {/if}
    </div>
</div>
{/if}
<!-- 轮播图 -->
<article class="user-head">

    <div class="user-info">
        <div class="shop_box">
            <div class="user-info-box">
                {if condition="$shop_info['shop_avatar'] !=''"}
                <img class="user-logo-shop" src="{:__IMG($shop_info['shop_avatar'])}">
                {else/}
                <img class="user-logo-shop" src="{:__IMG($default_shop_img)}">
                {/if}
            </div>
            <h1><span style="color: #232326;">{$shop_info['shop_name']}</span><br><span style="color: #999;">已经有{$fav_count}人收藏</span></h1>
            <div class="click_fav" onclick="collectionGoodsOrShop('.js-collection',{$shop_id},'shop','')" >
                {if condition="$is_member_fav_shop ==0"}
                <i class="fa fa-heart-o fav_icon"></i><span class="js-collection">{:lang('mark_shop')}</span>
                {else/}
                <i class="fa fa-heart fav_icon"></i><span class="js-collection">{:lang('goods_collected')}</span>
                {/if}
            </div>

        </div>
        <div class="grade">
            <ul>
                <li>描述
                    {if condition="$shop_info.shop_desccredit < 3"}
                        <span style="color: #fba534;">{$shop_info.shop_desccredit}分</span><em class="grade_icon" style="background: #fba534;">低</em>
                    {elseif condition="$shop_info.shop_desccredit == 3" /}
                    <span  style="color: #fba534;">{$shop_info.shop_desccredit}分</span><em class="grade_icon" style="background: #fba534;">中</em>
                    {else /}
                    <span  style="color: #fba534;">{$shop_info.shop_desccredit}分</span><em class="grade_icon" style="background: #fba534;">高</em>
                    {/if}
                </li>
                <li>服务
                    {if condition="$shop_info.shop_servicecredit < 3"}
                    <span style="color: #13ab53;">{$shop_info.shop_servicecredit}分</span><em class="grade_icon" style="background: #13ab53;">低</em>
                    {elseif condition="$shop_info.shop_servicecredit == 3"}
                    <span  style="color: #13ab53;">{$shop_info.shop_servicecredit}分</span><em class="grade_icon" style="background: #13ab53;">中</em>
                    {else}
                    <span  style="color: #13ab53;">{$shop_info.shop_servicecredit}分</span><em class="grade_icon" style="background: #13ab53;">高</em>
                    {/if}
                </li>
                <li>发货
                    {if condition="$shop_info.shop_deliverycredit < 3"}
                    <span style="color: #f447c9;">{$shop_info.shop_deliverycredit}分</span><em class="grade_icon" style="background: #f447c9;">低</em>
                    {elseif  condition="$shop_info.shop_deliverycredit == 3"}
                    <span  style="color: #f447c9;">{$shop_info.shop_deliverycredit}分</span><em class="grade_icon" style="background: #f447c9;">中</em>
                    {else}
                    <span  style="color: #f447c9;">{$shop_info.shop_deliverycredit}分</span><em class="grade_icon" style="background: #f447c9;">高</em>
                    {/if}
                </li>
            </ul>
        </div>
    </div>

    <div class="user-nav js-user-nav">
        <ul>
            <li><a href="{:__URL('APP_MAIN/shop/goodslist?shop_id='.$shop_id)}"><i class="fa fa-align-justify"></i>{:lang('all_goods')}</a>
            </li>
            <li><a href="{:__URL('APP_MAIN/shop/goodslist?shop_id='.$shop_id.'&type=3')}"><i class="fa fa-align-justify"></i>推荐</a>
            </li>
            <li><a href="{:__URL('APP_MAIN/shop/goodslist?shop_id='.$shop_id.'&type=1')}"><i class="fa fa-align-justify"></i>新品</a>
            </li>

            <li><a href="{:__URL('APP_MAIN/shop/goodslist?shop_id='.$shop_id.'&type=2')}"><i class="fa fa-align-justify"></i>热卖 </a>
            </li>
        </ul>
    </div>
</article>
{/block}

{block name="main" }
<div style="display:none;position: fixed;left: 10px;z-index: 999999;top:25%;border-radius: 100%;height:30px;width:30px;line-height: 30px;text-align: center;">
    <a href="{:__URL('APP_MAIN')}" style="color: #ffffff;">
        <img src="__TEMP__/{$style}/public/images/shop_goback.png"/>
    </a>
</div>

<div class="contact">
    <ul>
        <li><a href="http://wpa.qq.com/msgrd?v=3&uin={$shop_info.shop_qq}&site=qq&menu=yes">在线客服 <span class="icon"><i class="fa fa-user-o"></i></span></a></li>
        <li><a href="tel:{$shop_info.shop_phone}">商家电话 <span class="icon"><i class="fa fa-volume-control-phone"></i></span></a></li>
    </ul>
</div>


<div class="shop_desc">
    <ul>
        <!--<li><span>店铺简介</span> <span class="content"></span></li>-->
        <li><span>公司名称</span> <span class="content">{if condition="$shop_info.shop_company_name == ''"} {$shop_info.shop_name}  {else/} {$shop_info.shop_company_name}{/if}</span></li>
        <li><span>所在地区</span> <span class="content">{$shop_info.shop_address}</span></li>
        <li><span>店铺类型</span> <span class="content">{$group_info.group_name}</span></li>
        <li><span>商家等级</span> <span class="content">{$type_info.type_name}</span></li>
    </ul>
</div>
<input type="hidden" id="shop_id" value="{$shop_info['shop_id']}">
<input type="hidden" id="hidden_shop_id" value="{$shop_info['shop_id']}">

<script>var is_member_fav_shop = "{$is_member_fav_shop}";</script>
<div class="com-content">

    <style type="text/css">.custom-search-button {
        top: 1px !important;
    }</style>


</div>
{include file='wap/default_new/share'/}
<script>
    $(function () {
        img_lazyload();
        $.ajax({
            type: "post",
            url: "{:__URL('APP_MAIN/shop/getsharecontents')}",
            data: {
                'shop_id': $("#shop_id").val()
            },
            success: function (data) {
                //alert(JSON.stringify(data));
                /* $("#share_title").val(data['share_title']);
                 $("#share_desc").val(data['share_contents']);
                 $("#share_url").val(data['share_url']);
                 $("#share_img_url").val(data['share_img']);\ */
                wx.config({
                    debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
                    appId: $("#appId").val(), // 必填，公众号的唯一标识
                    timestamp: $("#jsTimesTamp").val(), // 必填，生成签名的时间戳
                    nonceStr: $("#jsNonceStr").val(), // 必填，生成签名的随机串
                    signature: $("#jsSignature").val(),// 必填，签名，见附录1
                    jsApiList: ['onMenuShareTimeline', 'onMenuShareAppMessage', 'onMenuShareQQ', 'onMenuShareWeibo'] // 必填，需要使用的JS接口列表，所有JS接口列表见附录2
                });
                wx.ready(function () {
                    var title = data['share_title'];
                    var share_contents = data['share_contents'] + '\r\n';
                    var share_nick_name = data['share_nick_name'] + '\r\n';
                    var desc2 = share_contents + share_nick_name + "{:lang('heat_collection')}：★★★★★";
                    var url = data['share_url'];
                    var img_url = data['share_img'];
                    wx.onMenuShareAppMessage({
                        title: title,
                        desc: desc2,
                        link: url,
                        imgUrl: img_url,
                        trigger: function (res) {
//			                alert('用户点击发送给朋友');
                        },
                        success: function (res) {
//			                alert('已分享');

                        },
                        cancel: function (res) {
                            //alert('已取消');
                        },
                        fail: function (res) {
                            //alert(JSON.stringify(res));
                        }
                    });

                    // 2.2 监听“分享到朋友圈”按钮点击、自定义分享内容及分享结果接口
                    wx.onMenuShareTimeline({
                        title: title,
                        link: url,
                        imgUrl: img_url,
                        trigger: function (res) {
                            // alert('用户点击分享到朋友圈');
                        },
                        success: function (res) {
                            //alert('已分享');

                        },
                        cancel: function (res) {
                            //alert('已取消');
                        },
                        fail: function (res) {
                            //     alert(JSON.stringify(res));
                        }
                    });

                    // 2.3 监听“分享到QQ”按钮点击、自定义分享内容及分享结果接口
                    wx.onMenuShareQQ({
                        title: title,
                        desc: desc2,
                        link: url,
                        imgUrl: img_url,
                        trigger: function (res) {
                            //alert('用户点击分享到QQ');
                        },
                        complete: function (res) {
                            //alert(JSON.stringify(res));
                        },
                        success: function (res) {
                            //alert('已分享');

                        },
                        cancel: function (res) {
                            //alert('已取消');
                        },
                        fail: function (res) {
                            //alert(JSON.stringify(res));
                        }
                    });

                    // 2.4 监听“分享到微博”按钮点击、自定义分享内容及分享结果接口
                    wx.onMenuShareWeibo({
                        title: title,
                        desc: desc2,
                        link: url,
                        imgUrl: img_url,
                        trigger: function (res) {
                            //alert('用户点击分享到微博');
                        },
                        complete: function (res) {
                            //alert(JSON.stringify(res));
                        },
                        success: function (res) {
                            //alert('已分享');

                        },
                        cancel: function (res) {
                            //alert('已取消');
                        },
                        fail: function (res) {
                            //alert(JSON.stringify(res));
                        }
                    });


                })

            }
        })

        $(".user-logo").next().css("padding-left", (parseInt($(".user-logo").width()) + 10) + "px");
    })
</script>


{/block}